﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Base关键字
{
    public class A
    {
        public virtual void Hello()
        {
            Console.WriteLine("Hello");
        }
    }

    public class B : A
    {
        public override void Hello()
        {
            base.Hello();//调用基类的方法,显示Hello
            Console.WriteLine("World");
        }
    static void Main()
    {
        B b = new B();
        Console.ReadKey();
    }
    }
}
